.no-scroll {
  height: 100%;
  overflow: hidden;
}

img.owo {
  width: 32px;
  height: 32px;
}

/** 编辑区域样式 */
.typecho-post-area {
  #text,
  #text + .resize {
    display: none;
  }
}

.vditor-preview {
  .vditor-reset {
    img {
      cursor: pointer;
    }

    x {
      &-player,
      &-bilibili {
        display: block;
        height: 260px;

        iframe {
          height: 100%;
          width: 100%;
        }
      }
    }

    photos {
      img {
        max-height: 100px;
      }
    }
  }
}

p.submit {
  &.fixed {
    position: fixed;
    bottom: 0;
    padding: 5px;
    margin: 0;
    background-color: #f6f8fa;
    border: 1px solid #d1d5da;
  }
}

/** 相册排列通用样式 */
photos,
x-photos {
  padding: 2px;
  display: flex;
  flex-wrap: wrap;

  &:after {
    content: '';
    flex-grow: 999999999;
  }

  br {
    display: none;
  }

  .photo {
    width: 33.3%;

    img {
      height: 100px;
      width: calc(100% - 4px);
      display: block;
      object-fit: cover;
      margin: 2px;
    }

    &:nth-last-child(4),
    &:nth-last-child(4) ~ .photo {
      flex-grow: 0;
    }
  }

  img {
    height: 200px;
    flex-grow: 1;
    margin: 2px;
    display: block;
    object-fit: cover;

    &:nth-last-child(4),
    &:nth-last-child(4) ~ img {
      flex-grow: 0;
    }
  }
}

@media (min-width: 768px) {
  photos {
    img {

      &:nth-last-child(6),
      &:nth-last-child(6) ~ .photo {
        flex-grow: 0;
      }

    }
  }
}

@media (min-width: 1200px) {
  photos {
    img {

      &:nth-last-child(8),
      &:nth-last-child(8) ~ .photo {
        flex-grow: 0;
      }

    }
  }
}

/** 短代码样式 */
.shortcode {
  margin-bottom: 10px;

  &.shortcode-checkbox {
    -webkit-appearance: none !important;
    position: relative;
    border-radius: 2px;
    width: 15px;
    height: 15px;
    border: 2px solid #409eff;
    vertical-align: -3px;
    box-sizing: border-box;
    margin: 0 5px 0 0;

    &[type="checkbox"] {
      -webkit-appearance: none !important;
    }

    &:disabled {
      cursor: not-allowed;
    }

    &:checked {
      border: none;
      background: #409eff;

      &::after {
        content: '';
        width: 4px;
        height: 10px;
        position: absolute;
        top: 2px;
        left: 5px;
        border: 2px solid #fff;
        border-top: 0;
        border-left: 0;
        transform: rotate(45deg);
      }
    }
  }

  &.shortcode-hide {
    padding: 10px 20px;
    border: 1px solid #eee;
    border-radius: 5px;
    display: block;
    margin-bottom: 10px;

    .hide {
      text-align: center;
      user-select: none;
      background: repeating-linear-gradient(145deg, #f2f2f2, #f2f2f2 15px, #fff 0, #fff 30px);
    }

    .show {
      background: #f2f2f2;
    }

    a {
      color: #409eff;
      transition: all .2s;
    }
  }

  &.shortcode-post {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
    padding: 20px;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    border: 1px solid #ebeef5;
    background: #fff;

    .text-content {
      flex: 1 1 auto;
      margin-right: 1em;

      .content {
        display: none;
      }
    }

    .media-content {
      max-height: 200px;
      position: unset;
      overflow: hidden;

      a {
        display: block;
      }

      img {
        object-fit: cover;
        width: 100%;
        height: 100%;
      }
      
      *:not(img, a) {
        display: none;
      }
    }

    .title {
      display: block !important;
      color: #222831;
      cursor: pointer;
      margin-bottom: .5em;
      font-size: 18px;
    }

    .content {
      color: #788a9a;
      max-height: 80px;
      overflow: hidden;

      p {
        line-height: 26px;
        padding: 0;
        margin: 0;
      }
    }
  }

  &.shortcode-x-title {
    display: flex;
    justify-content: center;
    padding: 10px 0;
    margin-bottom: 10px;

    span {
      position: relative;
      color: #909399;
      padding: 0 12px;
      transition: padding 0.35s;

      &:hover {
        padding: 0;
      }

      &:before,
      &:after {
        content: '';
        position: absolute;
        top: 50%;
        width: 20px;
        height: 1px;
        background: #409eff;
      }

      &:before {
        left: -35px;
      }

      &:after {
        right: -35px;
      }
    }
  }

  &.shortcode-x-btn {
    display: flex;
  }

  &.shortcode-x-card {
    display: block;
    margin: 0 auto;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    border: 1px solid #ebeef5;
    background: #fff;
    position: relative;

    > .title {
      cursor: pointer;
      display: block;
      padding: 8px 10px;
      border-bottom: 1px solid #ebeef5;
      color: #303133;
      user-select: none;

      &:after {
        content: "\f0d8";
        font: normal normal normal 14px/1 FontAwesome;
        text-rendering: auto;
        position: absolute;
        top: 15px;
        right: 15px;
        transform: rotate(0deg);
        transition: transform .2s;
      }
    }

    > .content {
      display: block;
      padding: 10px;
      color: #606266;
      transform: rotateX(0deg);
      transition: all .2s;
      transform-origin: 0 0;
    }

    &.fold {
      > .title {
        &:after {
          transform: rotate(180deg);
        }
      }

      > .content {
        transform: rotateX(-90deg);
        height: 0;
        padding: 0;
      }
    }
  }
}


@media (min-width: 768px) {
  .shortcode {
    &-post {
      flex-direction: row !important;

      .text-content {
        .content {
          display: block !important;

          *:last-child {
            margin-bottom: 0 !important;
          }
        }
      }

      .media-content {
        max-height: unset;
        flex: 0 0 25%;
      }
    }
  }
}


/** 自定义 DOM 样式 */
x {
  &-player,
  &-bilibili {
    display: block;
    width: 100%;

    iframe {
      width: 100%;
      height: 450px;
      border: 0;
    }
  }
}

.x {
  /** 模态框 */
  &-modal {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, 0);
    z-index: -1;
    visibility: hidden;
    transition: background .2s, visibility .2s;

    &-frame {
      background: #fff;
      width: 350px;
      border-radius: 5px;
      overflow: hidden;
      transition: transform 0.2s;
      transform-origin: 0 0;
      transform: rotateX(-90deg);
    }

    &.active {
      z-index: 10;
      visibility: visible;
      background: rgba(0, 0, 0, .5);

      .x-modal-frame {
        transform: rotateX(0deg);
      }
    }


    &-header {
      height: 40px;
      border-bottom: 1px solid #dbdbd6;
      position: relative;

      &-title {
        height: 40px;
        line-height: 40px;
        font-size: 16px;
        font-weight: bold;
        padding-left: 10px;
        color: #000;
      }

      &-close {
        position: absolute;
        right: 0;
        height: 40px;
        top: 0;
        line-height: 40px;
        width: 40px;
        text-align: center;
        cursor: pointer;
        color: #222831;
        transition: color, background-color .2s;

        &:hover {
          background-color: #e74c3c;
          color: #fff;
        }
      }
    }

    &-body {
      min-height: 60px;
      padding: 10px;

      .params {
        display: flex;
        flex-wrap: wrap;

        .form-item {
          display: flex;
          width: 100%;
          align-items: center;
          margin-bottom: 10px;

          &:last-child {
            margin-bottom: 0;
          }

          label {
            flex: 0 0 80px;
          }

          input, select, textarea {
            flex: 1 1 100%;

            &.required {
              border-color: red;
              animation: shake 800ms ease-in-out;
            }
          }
        }
      }

      .switch-tab {
        height: 400px;

        &-wrap {
          display: flex;
          overflow-x: scroll;

          .switch-tab-title {
            white-space: nowrap;
            padding: 5px;
            margin-bottom: 5px;
            box-sizing: border-box;
            cursor: pointer;

            &.active {
              border-bottom: 2px solid #000;
            }
          }
        }

        &-content-wrap {
          margin-top: 10px;
          overflow-y: scroll;
          height: 334px;
        }

        &-content {
          display: none;
          flex-wrap: wrap;


          &.active {
            display: flex;
          }

          .click-to-insert-char,
          .click-to-insert-data {
            padding: 5px;
            cursor: pointer;
            width: calc(12.5% - 10px);
            text-align: center;

            &:hover {
              background: #dbdbd6;
            }

            img {
              width: 100%;
              height: 100%;
              object-fit: contain;
            }

            &.text {
              width: calc(33.3% - 10px);
              display: flex;
              justify-content: center;
              align-items: center;
            }
          }
        }
      }

      .preview {
        padding: 10px;

        &.center {
          display: flex;
          justify-content: center;
          align-content: center;
        }

        .shortcode {
          margin-bottom: 0;
        }
      }
    }


    &-footer {
      border-top: 1px solid #dbdbd6;
      display: flex;
      align-items: center;
      padding: 5px 10px;

      &-button {
        outline: none;
        border: 0;
        -webkit-appearance: none;
        background: #eee;
        margin-left: 10px;
        height: 30px;
        padding: 5px 10px;
        transition: color, background-color .2s;
        cursor: pointer;

        &.x-modal-footer-confirm {
          background-color: #409eff;
          color: #fff;

          &:hover {
            background-color: #3498db;
          }
        }

        &:first-child {
          margin-left: auto;
        }

        &:hover {
          background-color: #dbdbd6;
        }
      }
    }
  }

  &-btn {
    display: flex;
    transition: all .2s;
    border: 1px solid transparent;

    &:not(.disabled):not(:disabled) {
      cursor: pointer;
    }

    .icon {
      padding: 8px;
      width: 36px;
      display: flex;
      justify-content: center;
      align-items: center;
      background-color: rgba(0, 0, 0, .1);
    }

    .content {
      padding: 8px;
      display: flex;
      justify-content: center;
      align-items: center;
    }

    &:hover {
      color: #fff;
      text-decoration: none;
    }
  }

  &-btn-shadow {
    box-shadow: 0 0 45px -5px rgba(158, 158, 158, 0.22) !important;
  }

  &-btn-group-sm > .btn,
  &-btn-sm {
    font-size: .75rem;
    padding: 0.25rem 0.75rem;
  }

  &-btn-primary {
    background-color: #f1404b;
    border-color: #f1404b;
    box-shadow: 0 5px 20px -3px rgba(249, 100, 90, 0.6) !important;

    &:hover {
      color: #fff;
      background-color: #222831;
      border-color: #222831;
      box-shadow: 0 5px 20px -3px rgba(37, 44, 65, 0.33) !important;
    }

    &:focus,
    &.focus {
      color: #fff;
      background-color: #222831;
      border-color: #222831;
      box-shadow: none;
    }

    &:not(:disabled):not(.disabled) {

      &:active:focus,
      &.active:focus {
        color: #fff;
        background-color: #222831;
        border-color: #222831;
        box-shadow: none;
      }
    }
  }


  &-btn-primary {
    color: #fff;

    &.disabled,
    &:disabled {
      color: #fff;
      background-color: #f1404b;
      border-color: #f1404b;
    }

    &:not(:disabled):not(.disabled) {

      &:active,
      &.active {
        color: #fff;
        background-color: #f1404b;
        border-color: #f1404b;
      }
    }
  }

  &-btn-secondary {
    background-color: #252c41;
    border-color: #252c41;
    color: #fff;

    &:hover,
    &:focus,
    &.focus {
      color: #fff;
      background-color: #222831;
      border-color: #222831;
      box-shadow: 0 5px 20px -3px rgba(37, 44, 65, 0.33) !important;
    }

    &:not(:disabled):not(.disabled) {

      &:active:focus,
      &.active:focus {
        color: #fff;
        background-color: #222831;
        border-color: #222831;
        box-shadow: 0 5px 20px -3px rgba(37, 44, 65, 0.33) !important;
      }
    }

    &.disabled,
    &:disabled {
      color: #f4f5f9;
      background-color: #222831;
      border-color: #222831;
    }

    &:not(:disabled):not(.disabled) {

      &:active,
      &.active {
        color: #f4f5f9;
        background-color: #222831;
        border-color: #222831;
      }
    }

    .content {
      background-color: rgba(255, 255, 255, .1);
    }
  }

  &-btn-light {
    color: #252c41;
    background-color: #f4f5f9;
    border-color: #f4f5f9;

    &:hover {
      color: #fff;
      background-color: #222831;
      border-color: #222831;
      box-shadow: 0 5px 20px -3px rgba(37, 44, 65, 0.33);
    }

    &:focus,
    &.focus {
      color: #9d9fa9;
      background-color: #f4f5f9;
      border-color: #f4f5f9;
      box-shadow: none;
    }

    &:not(:disabled):not(.disabled) {

      &:active:focus,
      &.active:focus {
        color: #9d9fa9;
        background-color: #f4f5f9;
        border-color: #f4f5f9;
        box-shadow: none;
      }
    }

    &.disabled,
    &:disabled {
      color: #9d9fa9;
      background-color: #f1eff3;
      border-color: #f1eff3;
    }

    &:not(:disabled):not(.disabled) {

      &:active,
      &.active {
        color: #9d9fa9;
        background-color: #f4f5f9;
        border-color: #f4f5f9;
      }
    }
  }

  &-btn-outline-light {
    color: #252c41;
    background-color: var(--background);
    background-image: none;
    border-color: #f4f5f9;

    &:hover {
      color: #222831;
      background-color: var(--background);
      border-color: #f4f5f9;
    }

    &:focus,
    &.focus {
      box-shadow: 0 0 0 0.2rem rgba(248, 249, 250, 0.5);
    }

    &.disabled,
    &:disabled {
      color: #f8f9fa;
      background-color: #f4f5f9;
    }

    &:not(:disabled):not(.disabled) {

      &:active,
      &.active {
        color: #9d9fa9;
        background-color: var(--background);
        border-color: #f4f5f9;
      }
    }
  }

  &-btn-outline-light:not(:disabled):not(.disabled) {

    &:active:focus,
    &.active:focus {
      box-shadow: 0 0 0 0.2rem rgba(248, 249, 250, 0.5);
    }
  }

  &-btn-outline-secondary {
    color: #252c41;
    background-color: transparent;
    background-image: none;
    border-color: #252c41;

    &:hover {
      color: #fff;
      background-color: #252c41;
      border-color: #252c41;
    }

    &:focus,
    &.focus {
      box-shadow: none;
      color: #fff;
      background-color: #252c41;
      border-color: #252c41;
    }

    &.disabled,
    &:disabled {
      color: #252c41;
      background-color: transparent;
    }

    &:not(:disabled):not(.disabled) {

      &:active,
      &.active {
        color: #fff;
        background-color: #dddfe6;
        border-color: #dddfe6;
      }
    }
  }

  &-btn-outline-secondary:not(:disabled):not(.disabled) {

    &:active:focus,
    &.active:focus {
      box-shadow: none;
    }
  }

  &-btn-info {
    color: #fff;
    background-color: #17a2b8;
    border-color: #17a2b8;

    &:hover {
      background-color: #138496;
      border-color: #117a8b;
    }

    &:active {
      color: #fff;
      background-color: #117a8b;
      border-color: #10707f;
    }

    &:focus {
      color: #fff;
      background-color: #138496;
      border-color: #117a8b;
      box-shadow: 0 0 0 .2rem rgba(58, 176, 195, .5);
    }
  }

  &-btn-success {
    color: #fff;
    background-color: #28a745;
    border-color: #28a745;

    &:hover {
      background-color: #218838;
      border-color: #1e7e34;
    }

    &:active {
      color: #fff;
      background-color: #1e7e34;
      border-color: #1c7430;
    }

    &:focus {
      color: #fff;
      background-color: #218838;
      border-color: #1e7e34;
      box-shadow: 0 0 0 .2rem rgba(72, 180, 97, .5);
    }
  }

  &-btn-warning {
    color: #212529;
    background-color: #ffc107;
    border-color: #ffc107;

    &:hover {
      color: #212529;
      background-color: #e0a800;
      border-color: #d39e00;

    }

    &:active {
      color: #212529;
      background-color: #d39e00;
      border-color: #c69500;
    }

    &:focus {
      color: #212529;
      background-color: #e0a800;
      border-color: #d39e00;
      box-shadow: 0 0 0 .2rem rgba(222, 170, 12, .5);
    }
  }

  &-btn-rounded {
    border-radius: 4rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /*--------------------------------------------------------------
        btn style
    --------------------------------------------------------------*/

  &-btn-clipboard {
    padding: .25rem .5rem;
    font-size: 65%;
    color: #007bff;
    background-color: #fff;
    border: 1px solid;
    border-radius: .25rem;
  }

  &-btn-weibo:hover {
    background-color: #e24040;
    border-color: #e24040;
  }

  &-btn-weixin:hover {
    background-color: #20b767;
    border-color: #20b767;
  }

  &-btn-alipay {
    background-color: #0AE;
    border-color: #0AE;
  }

  &-btn-youku {
    background-color: #1f82fc;
    border-color: #1f82fc;
  }

  &-btn-toutiao {
    background-color: #ed4040;
    border-color: #ed4040;
  }

  &-btn-youtube {
    background-color: #ff0400;
    border-color: #ff0400;
  }

  &-btn-twitter {
    background-color: #1da1f2;
    border-color: #1da1f2;
  }

  &-btn-facebook {
    background-color: #365899;
    border-color: #365899;
  }

  &-btn-bilibili {
    background-color: #fb7299;
    border-color: #fb7299;
  }

  &-btn-ins {
    background-color: #ed4956;
    border-color: #ed4956;
  }

  &-btn-tumblr {
    background-color: #36465d;
    border-color: #36465d;
  }

}

/** 动画 */
@keyframes shake {
  10%, 90% {
    transform: translate3d(-1px, 0, 0);
  }
  20%, 80% {
    transform: translate3d(+2px, 0, 0);
  }
  30%, 70% {
    transform: translate3d(-4px, 0, 0);
  }
  40%, 60% {
    transform: translate3d(+4px, 0, 0);
  }
  50% {
    transform: translate3d(-4px, 0, 0);
  }
}